Method and apparatus for averaging out variations in run-to-run path data of a computer program

ABSTRACT

A method and apparatus for averaging out variations from run to run of a computer program are provided. With the apparatus and method, call trees are generated for two or more executions of a build of a computer program. The apparatus and method perform a “tree-addition” operation in which the two or more call trees generated during runs of the computer program are added to one another to thereby accumulate statistics for each call in the call trees. These statistics may then be divided by the number of runs whose tree data structures are being accumulated. In this way, an average of the tree data structures is generated. In addition, any portions of the tree data structure that are due to asynchronous events are averaged out so that their relative affect in the resulting tree data structure is minimized.

RELATED APPLICATIONS

The present application is related to co-pending and commonly assignedU.S. patent application Ser. No. 10/777,872, entitled “Method andApparatus for Identifying Differences in Runs of a Computer Program Dueto Code Changes”, U.S. patent application Ser. No. 10/777,909, entitled“Method and Apparatus for Removal of Asynchronous Events in ComplexApplication Performance Analysis”, and U.S. patent application Ser. No.10/777,743, entitled “Method and Apparatus for Automatic Detection ofBuild Regressions”, all of which are filed concurrently herewith and arehereby incorporated by reference.

BACKGROUND OF THE INVENTION

1. Technical Field

The present invention is generally directed to an improved computingsystem for tracing the execution of a computer program. Morespecifically, the present invention is directed to a method andapparatus for identifying differences in runs of a computer program dueto changes in the code of the computer program.

2. Description of Related Art

When developing new software for use in complex computing environments,it is beneficial to conduct performance analysis on the software withinthe computing environments in which they are to be deployed to determinepossible problems associated with the software or optimizations that maybe performed on the software. This is the realm of the performanceanalyst. The performance analyst's job is straightforward: measureperformance, find constraints to the level of performance achieved,eliminate or reduce their effects, and then start again; stop whenmeasured performance achieves a previously agreed-to target. Thechallenges are enormous. Software performance can be degraded by manyfactors, e.g., by a particular hardware configuration, by the way thehardware is used by the software, by poor programming practices in theunderlying operating system, by unexpected interactions between softwaremodules, by inappropriate use of system resources by application ormiddleware software, and by poor programming or data-structuringtechnique in the application.

The analyst's objective is to isolate the primary cause and deal with itas quickly as possible. Even for small software applications this can bea difficult task. For highly complex environments this task can be quitedaunting.

Many tools have been developed to assist analysts in dealing with thesechallenges. These tools include system and application profilers, e.g.,AIX (Advanced Interactive Executive) tprof, gprof, Intel Corporation'sVTune, application and system tracing facilities, e.g., AIX Trace,application and system memory use profilers, e.g., svmon, and systemperformance monitors, e.g., Windows NT Performance Monitor.Implementations of these and similar tools exist on many (though notall) platforms. Unfortunately, their implementations are not consistent,their output formats not readily comparable, and their models forcomputation and resource consumption not equivalent.

In order to provide a unifying approach for performance measurement,reporting, and analysis, International Business Machines, Inc. developedthe arcflow technology which is described in “A Unifying Approach toPerformance Analysis in the Java Environment”, IBM Systems Journal, vol.39, no. 1, 2000, authored by W. P. Alexander, R. F. Berry, F. E. Levine,and R. J. Urquhart. The arcflow technology provides a mechanism forunifying the recording and reporting components of performance analysisinto a single data model and standard set of reports. Arcflow generatesreports, i.e. xtrees, which are in the form of “call trees” thatidentify the parent child relationship between functions or methods aswell as information about resource consumption of each function ormethod.

While arcflow provides an extremely useful analysis of trace dataobtained from a trace of a computer program, the arcflow tool and thereports generated by the arcflow tool does not in itself provideinformation regarding differences between builds of a computer program.That is, there is no mechanism within arcflow to identify differencesbetween the runs of two or more different builds of a computer programto ascertain differences in performance due to changes in the computerprogram. In addition, there is no mechanism within arcflow for averagingout asynchronous variations in the trace data of a plurality ofexecutions of a computer program. Moreover, there is no mechanism withinarcflow that allows for removal of asynchronous events either in thesame or different builds of a computer program, so that analysis mayfocus on those areas of the computer program that consistently andappreciably affect the execution of the computer program.

Therefore, it would be beneficial to have an apparatus and method foridentifying differences in runs of two or more different builds of acomputer program based on call tree data structures generated based ontrace data for the runs of these builds of the computer program. Itwould further be beneficial to have an apparatus and method foraveraging out asynchronous variations in trace data of a plurality ofexecutions of a computer program. Moreover, it would be beneficial tohave an apparatus and method for removing asynchronous events in tracedata for runs of a either the same or different builds of a computerprogram.

SUMMARY OF THE INVENTION

The present invention, in exemplary embodiments, improves upon the knownarcflow tool by providing mechanisms that operate on trace informationfor multiple runs of the same or different builds of a computer program.In one exemplary embodiment, the present invention provides a mechanismfor determining differences between runs of different builds of acomputer program. With this embodiment of the present invention, calltrees are generated for two or more builds of a computer program. Thepresent invention involves performing a “tree-subtract” operation inwhich the two or more call trees generated during runs of two or moredifferent builds of a computer program are subtracted from one anotherto identify build to build differences in the execution of the computerprogram.

As an example of this tree subtraction, two call trees generated basedon traces of the execution of two different builds, A and B, of acomputer program are considered. The process starts by generating a copyof the call tree for the first build A and adding a pass field which isset to 1 for each of the nodes of the call tree A. The call tree for thesecond build B is then walked over the copy of the call tree for thefirst build A. That is, at each step of walking the tree for the secondbuild B, if a corresponding node exists in the copy of the call tree forthe first build A, then the calls/base value for this node is set to thecalls/base of the copy of the first call tree A minus the calls/base ofthe second call tree B. The pass field is then set to 3 to denote thatboth the first call tree A and the second call tree B contributed to thenode.

If there is no corresponding node that exists in the first call tree A,then a node is created with a negative value of base and calls for thesecond call tree B. In this case, the pass field is set to 2 denotingthat only the second call tree contributed to this node.

After walking the entire second tree and performing the subtraction inthis manner above, a resulting tree data structure is obtained thatretains all the call stack context from either of the first and secondcall tree. All of the base/call values in the resulting tree datastructure are the difference between the two original trees. The passvalue may be provided in the depiction of the resulting tree as well sothat it is clear which call trees contributed to each node of theresulting tree.

From the resulting tree, portions of the runs of the different builds ofthe computer program where the resource utilization of the computerprogram has not changed are easily identifiable because the absolutevalue of the base at that node will be very small or zero. Moreover,portions of the runs of the different builds of the computer programwhere there are improvements or regressions in resource utilization ofthe computer program may be easily identifiable because the value of thebase will be large, and positive for improvements or negative forregressions.

In addition to the above, a method and apparatus for averaging outvariations from run to run of a computer program are provided. With theapparatus and method according to these embodiments, call trees aregenerated for two or more executions of a build of a computer program.The apparatus and method perform a “tree-addition” operation in whichthe two or more call trees generated during runs of the computer programare added to one another to thereby accumulate statistics for each callin the call trees. These statistics may then be divided by the number ofruns whose tree data structures are being accumulated. In this way, anaverage of the tree data structures is generated. In addition, anyportions of the tree data structure that are due to asynchronous eventsare averaged out so that their relative affect in the resulting treedata structure is minimized.

In other embodiments of the present invention, a method and apparatusfor identifying a minimum call tree data structure from a plurality ofcall tree data structures are provided. With the apparatus and method ofthese embodiments, call tree data structures are generated for two ormore executions of a build of a computer program. The apparatus andmethod perform a “tree-minimization” operation in which the two or morecall trees generated during runs of the computer program are walked andonly those nodes that are present in each of the tree data structuresare maintained in a minimized tree data structure. In addition, theminimum values for these common nodes are maintained in the minimizedtree data structure. In this way, asynchronous events are removed fromthe minimum tree data structure and analysis may focus on those areas ofthe computer program that are consistent between runs of the computerprogram.

In yet other embodiments of the present invention, a method andapparatus for automatically performing regression processing on tracedata are provided. With the apparatus and method according to theseembodiments, call tree data structures are generated for two or moreexecutions of two or more builds of a computer program. The apparatusand method perform a “tree-minimization” operation on each set of calltree data structures for each of the builds to generate minimized calltree data structures for each build of the computer program. Theminimized call tree data structures are then subtracted from one anotherto generate a subtracted minimized call tree data structure.

From this subtracted minimized call tree data structure, the portions ofthe computer program that are different from build to build and whichappreciably and consistently affect the difference in execution of thecomputer program from build to build may be identified. Thus, theanalyst's attention is directed to these areas of the computer programcode which may be optimized in order to obtain better execution of thecomputer program.

These and other features and advantages of the present invention will bedescribed in, or will become apparent to those of ordinary skill in theart in view of, the following detailed description of the preferredembodiments.

BRIEF DESCRIPTION OF THE DRAWINGS

The novel features believed characteristic of the invention are setforth in the appended claims. The invention itself, however, as well asa preferred mode of use, further objectives and advantages thereof, willbest be understood by reference to the following detailed description ofan illustrative embodiment when read in conjunction with theaccompanying drawings, wherein:

FIG. 1 is an exemplary diagram of a distributed data processing systemin which the present invention may be implemented;

FIG. 2 is an exemplary diagram of a server computing device in whichaspects of the present invention may be implemented;

FIG. 3 is an exemplary diagram of a client or stand-alone computingdevice in which aspects of the present invention may be implemented;

FIG. 4 is an exemplary diagram illustrating trace data that may be usedas input to an arcflow tool;

FIG. 5 is an exemplary diagram of a call tree for the exemplary inputshown in FIG. 4;

FIG. 6 is an example of an xarc report generated by the arcflow toolusing the input shown in FIG. 4;

FIG. 7 is an example of an xtree report data structure that is generatedby the arcflow tool using the input shown in FIG. 4;

FIG. 8A is an example of trace data generated by a trace of a run of afirst build of a computer program;

FIG. 8B is an example of trace data generated from a trace of a run of asecond build of a computer program;

FIGS. 9A and 9B illustrate call tree data structures of FIGS. 8A and 8Bin a graphical format;

FIGS. 10A and 10B illustrate the same call tree data structures in atextual format;

FIG. 11 illustrates a call tree data structure obtained by subtractingthe call tree data structure of FIG. 9B from the call tree datastructure of FIG. 9A;

FIG. 12 is an exemplary subtraction xtree report data structuregenerated by the present invention;

FIG. 13 is a flowchart outlining an exemplary operation of the presentinvention when generating a subtraction call tree data structure;

FIGS. 14A and 14B are exemplary diagrams of call tree data structuresfor describing addition of call tree data structures in accordance withone exemplary embodiment of the present invention;

FIG. 14C is an exemplary diagram of a call tree data structure resultingfrom the addition of the call tree data structures of FIGS. 14A and 14B;

FIG. 15 is an exemplary xtree data structure corresponding to the calltree data structure of FIG. 11;

FIG. 16 is a flowchart outlining an exemplary operation of the presentinvention when adding call tree data structures for a plurality of runsof a computer program and averaging out variations from run to run;

FIGS. 17A-C are exemplary diagrams of graphical representations of xtreedata structures that may be generated based on trace data obtained fromruns of the same build of a computer program;

FIG. 18A is an exemplary diagram of a graphical representation of theminimum xtree data structure generated by walking of the xtree datastructure of FIG. 17B over the xtree data structure of FIG. 17A;

FIG. 18B is an xtree data structure obtained by walking the xtree datastructure of FIG. 17C over the minimum xtree data structure of FIG. 18A;

FIG. 19 is a flowchart outlining an exemplary operation of the presentinvention when generating a minimized xtree data structure; and

FIG. 20 is a flowchart outlining an exemplary operation of the presentinvention when performing autonomic performance regression processing.

DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENT

The present invention provides a mechanism for identifying differencesin runs of a computer program due to changes in the code of the computerprogram. As such, the present invention may be implemented in a standalone computing device or a distributed data processing system.Therefore, the follow FIGS. 1-3 are provided as examples of suchcomputing environments in which the present invention may beimplemented. FIGS. 1-3 are only exemplary and are not intended to assertor imply any limitation on the environments in which the presentinvention may be used or deployed.

With reference now to the figures, FIG. 1 depicts a pictorialrepresentation of a network of data processing systems in which thepresent invention may be implemented. Network data processing system 100is a network of computers in which the present invention may beimplemented. Network data processing system 100 contains a network 102,which is the medium used to provide communications links between variousdevices and computers connected together within network data processingsystem 100. Network 102 may include connections, such as wire, wirelesscommunication links, or fiber optic cables.

In the depicted example, server 104 is connected to network 102 alongwith storage unit 106. In addition, clients 108, 110, and 112 areconnected to network 102. These clients 108, 110, and 112 may be, forexample, personal computers or network computers. In the depictedexample, server 104 provides data, such as boot files, operating systemimages, and applications to clients 108-112. Clients 108, 110, and 112are clients to server 104. Network data processing system 100 mayinclude additional servers, clients, and other devices not shown. In thedepicted example, network data processing system 100 is the Internetwith network 102 representing a worldwide collection of networks andgateways that use the Transmission Control Protocol/Internet Protocol(TCP/IP) suite of protocols to communicate with one another. At theheart of the Internet is a backbone of high-speed data communicationlines between major nodes or host computers, consisting of thousands ofcommercial, government, educational and other computer systems thatroute data and messages. Of course, network data processing system 100also may be implemented as a number of different types of networks, suchas for example, an intranet, a local area network (LAN), or a wide areanetwork (WAN). FIG. 1 is intended as an example, and not as anarchitectural limitation for the present invention.

Referring to FIG. 2, a block diagram of a data processing system thatmay be implemented as a server, such as server 104 in FIG. 1, isdepicted in accordance with a preferred embodiment of the presentinvention. Data processing system 200 may be a symmetric multiprocessor(SMP) system including a plurality of processors 202 and 204 connectedto system bus 206. Alternatively, a single processor system may beemployed. Also connected to system bus 206 is memory controller/cache208, which provides an interface to local memory 209. I/O bus bridge 210is connected to system bus 206 and provides an interface to I/O bus 212.Memory controller/cache 208 and I/O bus bridge 210 may be integrated asdepicted.

Peripheral component interconnect (PCI) bus bridge 214 connected to I/Obus 212 provides an interface to PCI local bus 216. A number of modemsmay be connected to PCI local bus 216. Typical PCI bus implementationswill support four PCI expansion slots or add-in connectors.Communications links to clients 108-112 in FIG. 1 may be providedthrough modem 218 and network adapter 220 connected to PCI local bus 216through add-in connectors.

Additional PCI bus bridges 222 and 224 provide interfaces for additionalPCI local buses 226 and 228, from which additional modems or networkadapters may be supported. In this manner, data processing system 200allows connections to multiple network computers. A memory-mappedgraphics adapter 230 and hard disk 232 may also be connected to I/O bus212 as depicted, either directly or indirectly.

Those of ordinary skill in the art will appreciate that the hardwaredepicted in FIG. 2 may vary. For example, other peripheral devices, suchas optical disk drives and the like, also may be used in addition to orin place of the hardware depicted. The depicted example is not meant toimply architectural limitations with respect to the present invention.

The data processing system depicted in FIG. 2 may be, for example, anIBM eServer pSeries system, a product of International Business MachinesCorporation in Armonk, N.Y., running the Advanced Interactive Executive(AIX) operating system or Linux operating system.

With reference now to FIG. 3, a block diagram illustrating a dataprocessing system is depicted in which the present invention may beimplemented. Data processing system 300 is an example of a clientcomputer or stand-alone computing device. Data processing system 300employs a peripheral component interconnect (PCI) local busarchitecture. Although the depicted example employs a PCI bus, other busarchitectures such as Accelerated Graphics Port (AGP) and IndustryStandard Architecture (ISA) may be used. Processor 302 and main memory304 are connected to PCI local bus 306 through PCI bridge 308. PCIbridge 308 also may include an integrated memory controller and cachememory for processor 302. Additional connections to PCI local bus 306may be made through direct component interconnection or through add-inboards. In the depicted example, local area network (LAN) adapter 310,SCSI host bus adapter 312, and expansion bus interface 314 are connectedto PCI local bus 306 by direct component connection. In contrast, audioadapter 316, graphics adapter 318, and audio/video adapter 319 areconnected to PCI local bus 306 by add-in boards inserted into expansionslots. Expansion bus interface 314 provides a connection for a keyboardand mouse adapter 320, modem 322, and additional memory 324. Smallcomputer system interface (SCSI) host bus adapter 312 provides aconnection for hard disk drive 326, tape drive 328, and CD-ROM drive330. Typical PCI local bus implementations will support three or fourPCI expansion slots or add-in connectors.

An operating system runs on processor 302 and is used to coordinate andprovide control of various components within data processing system 300in FIG. 3. The operating system may be a commercially availableoperating system, such as Windows XP, which is available from MicrosoftCorporation. An object oriented programming system such as Java may runin conjunction with the operating system and provide calls to theoperating system from Java programs or applications executing on dataprocessing system 300. “Java” is a trademark of Sun Microsystems, Inc.Instructions for the operating system, the object-oriented programmingsystem, and applications or programs are located on storage devices,such as hard disk drive 326, and may be loaded into main memory 304 forexecution by processor 302.

Those of ordinary skill in the art will appreciate that the hardware inFIG. 3 may vary depending on the implementation. Other internal hardwareor peripheral devices, such as flash read-only memory (ROM), equivalentnonvolatile memory, or optical disk drives and the like, may be used inaddition to or in place of the hardware depicted in FIG. 3. Also, theprocesses of the present invention may be applied to a multiprocessordata processing system.

As another example, data processing system 300 may be a stand-alonesystem configured to be bootable without relying on some type of networkcommunication interfaces. As a further example, data processing system300 may be a personal digital assistant (PDA) device, which isconfigured with ROM and/or flash ROM in order to provide non-volatilememory for storing operating system files and/or user-generated data.

The depicted example in FIG. 3 and above-described examples are notmeant to imply architectural limitations. For example, data processingsystem 300 also may be a notebook computer or hand held computer inaddition to taking the form of a PDA. Data processing system 300 alsomay be a kiosk or a Web appliance.

As mentioned above, the present invention provides a mechanism foridentifying differences in the runs of a computer program that are dueto a changes in the code of the computer program. The present inventioninvolves performing a “tree-subtract” operation in which two call treesgenerated during runs of two different builds of a computer program aresubtracted from one another to identify build to build differences inthe execution of the computer program.

The present invention, in a preferred embodiment, is built upon thearcflow technology developed by International Business Machines, Inc.Therefore, a brief explanation of arcflow and some of the standardreports generated by arcflow will now be provided.

Arcflow attempts to provide information for indicating the relationshipsbetween resources and resource consumers, or simply “consumers.” A“resource” is any computing resource that may be consumed by a resourceconsumer, e.g., processor cycles, memory, and the like. A “consumer” isa portion of code that makes use of, or consumes, a resource. Forexample, a method of a Java program may be a “consumer” of processorcycles and/or memory during execution of the computer program.

Arcflow provides the relationship information for identifyingrelationships between consumers and resources in order to help analystsdetermine answers to questions such as what resources are beingconsumed, where the resources are being consumed, why the resources arebeing consumed, and the like. In order to capture the key relationshipsbetween consumers and resources necessary to help analysts answerperformance analysis “what,” “where,” and “why” questions, the followingthree definitions are provided.

Definition of consumer_context: A consumer_context is an abstraction ofthe state of a consumer at the point of resource consumption. Thismapping reflects the state of the consumer at the time the consumptionof the resource in question is recorded. A consumer_context is definedas a set of consumer identifiers and an optional time stamp:{c₁, C₂, . . . c_(n), t}where c_(i), 1≦i≦n, is the identifier (ID) of the ith consumer and t isthe time stamp. There is an explicit hierarchy, i.e., c_(i) is theparent of c_(i+1). Each c_(i) corresponds to a consumer, with c_(n)being the consumer most immediately responsible for the resourceconsumption, c_(n−1) is the consumer responsible for the actions ofc_(n), and so on. This hierarchy reflects the desired context in thelevel of detail appropriate for the analysis, e.g., one naturalconsumer_context hierarchy is a consumer calling sequence.

The rationale behind this definition is that resource consumption occursin context. It is important to understand that context when exploringperformance improvements. For example, a “call stack” A-B-C, reflectingthat function A called function B which called function C, is a validconsumer_context. Any resources consumed by function C when function Band function A are on its invocation or call stack are considereddistinct from resources consumed under a different invocation stack,even if consumed by (i.e., within) function C. A more detailed varianton the above might record the call stack in more detail, e.g.,A:F0001330-B:F0002992-C:F0010122, where the hex addresses following thefunction name indicate the actual virtual address of the invocation (thevalue lies in discriminating between multiple call sites in a function).Another valid consumer_context would record both the call stack and timestamp at the time of the resource consumption.

Although the most common consumer_context reflects a function/methodinvocation hierarchy, it need not. Other variants include:

1) Object containment hierarchy (where each consumer ID, c_(i),represents a unique object). The hierarchy reflects that object c_(i)contains c_(i+1).

2) Object allocation/creation hierarchy (where each c_(i) againrepresents a unique object). The hierarchy reflects that object c_(i)created c_(i+1).

3) Module invocation hierarchy (where each c_(i) indicates a module).This hierarchy is equivalent to the calling sequence hierarchy but witha different level of granularity for the consumer identifiers.

4) Basic block invocation hierarchy (where each c_(i) indicates aninstruction-level basic block). Again, this is an invocation hierarchybut, in this case, one that employs a finer granularity.

Definition of resource_consumption_list: A resource_consumption_list isa list of resources and an indication of the total amount of resourcesconsumed. When coupled with a consumer_context, the combinationrepresents the total amount of each resource consumed within a specificcontext. For example, <“object allocations” 100, “heap bytes allocated”12450> is a resource_consumption_list indicating that a total of 100object allocations have been made and that 12450 bytes have beenallocated from the heap.

Definition of arcflow model: The arcflow model couples consumer_contextdata and resource_consumption_list data in order to provide a usefulindication of resources used in some context. Thus, the general model ofresource consumption consists of a set of triples and a descriptivevector:

-   -   AF0 ≡{(X, n, Y) such that    -   X is a consumer_context,    -   n is the number of times this consumer_context has been        encountered, and    -   Y is a resource_consumption_list}and    -   Z is a vector of descriptive bindings where z provides:    -   1) A label describing the consumer identifiers (c_(i)) in X        (e.g., “functions”);    -   2) A label describing the units employed in the        resource_consumption_list (e.g., “CPU_time,” “instructions”);        and    -   3) A label describing the meaning of n-the number of times a        consumer_context is encountered (e.g., “calls,” “entries”).

Note that, depending on the granularity of the abstraction employed,this definition allows for the discrimination between executions offunction A resulting from being called by function B and those resultingfrom being called by function C. Also note that if the consumer_contextincludes a time stamp, the model can record an explicit log of allevents, in effect a trace of system behavior, with respect to allinteresting consumer states and resources they have consumed.

It should further be noted that the model is unitless. Thischaracteristic is a powerful abstraction that allows it to be employedin a broad range of analyses. Indeed, it is the key to the success ofthe model in unifying data recording and reporting. However, unitlessreports are not very helpful, so Z is introduced to allow for thelabeling of fields produced by the tools that implement the model andderivative reports.

Although the above is quite general, it has been found that a storageefficient and computationally efficient choice for the consumer_contextis to eliminate the explicit time stamp. Similarly, it has been foundthat restricting the resource_consumption_list to a single resource(thus providing only a univariate view of resource consumption) ishighly effective for focused analysis where the key resource of interestis known in advance. Therefore, for the remainder of this description,the term arcflow will refer to the restricted arcflow model:

-   -   AF1 ≡{(X, n, Y) such that    -   X is a consumer_context having no time stamp, n is the number of        times this consumer_context has been encountered;    -   Y is a resource_consumption_list consisting of a single        resource}; and    -   Z, a vector of descriptive bindings.

The model described in the foregoing, AF1, forms the basis for apowerful set of standard performance reports. It is these reports thatanalysts use to answer the “what”, “where” and “why” questions above.

FIG. 4 is an exemplary diagram illustrating trace data that may be usedas input to an arcflow tool. The trace data shown in FIG. 4 may be rawtrace data of a computer program execution collected using a traceapplication. The raw trace data identifies resource acquisition andrelease events during the execution of an exemplary computer program,i.e. AC_test.

Two types of records exist in the depicted example. The first record inthe example indicates a process/thread switch. In this case, the firstrecord of the depicted example indicates that all subsequent records (upto the next process/thread switch) reflect activity performed by theprocess/thread: AC_test. The name is only illustrative. In general,process/thread identifiers have a different appearance from that shownin FIG. 4.

The next type of record indicates either the start of a resource use(denoted by “>”) or the end of a resource use (denoted by “<”). The nameof the consumer is also indicated (in this case, the name of a method inthe Java program). In the depicted example, the names of the consumersare simply alphanumeric characters for simplicity, however in real-worlduse, the names of the consumers may be more complex strings ofcharacters.

Each record is marked with a resource consumption level. The resourcesare those whose consumption is measured (e.g., system CPU time, wallclock time, instructions executed, and the like). In the depictedexample, the metric is CPU time in seconds, and each trace record beginswith a CPU time stamp.

As a result, the trace data in FIG. 4 may be read as 0 seconds of CPUtime are used and then method A is entered. Thereafter, 1 second of CPUtime is used and method B is entered. One more second of CPU time isused and method B exits and control returns to method A. From thisinformation, it can be determined that up to this point in the trace,Main has used no CPU time, method A has used 1 second of CPU time andcalled method B, and that method B has used one second of CPU time, andso on.

When input into the arcflow tool, the resulting arcflow modelrepresentation for the performance data in FIG. 4 is shown in Table 1below:

TABLE 1 Arcflow model data for AC_test n X number of Y consumer_contextoccurrences resource_consumption “Method names” “Number of calls”“cpu-seconds” Main 1 0 Main A 1 1 Main A B 2 2 Main A B C 1 1 Main B 1 1Main B A 1 1 Main B A C 1 1 Main B A X 1 0 Main B A X E 1 1 Main B A X F1 1 Main B A X G 1 1

In the above table, the differences in the time stamps of successivetrace records have been used to compute the total resource_consumptionfor each consumer_context, and the time stamps themselves are no longerneeded. The explicit representation of the consumer_context, in thiscase the callstack, provides the additional information required to gaininsight into the “where” and “why” analysis questions. In particular,the context provides more information about application structure andexplicitly surfaces leverage points for performance improvement.

There is significant redundancy in the model shown in Table 1. Inparticular, many of the consumer context entries share common prefixes(e.g., “Main B A”). Fortunately, the structure and semantics of theconsumer context allow for very efficient storage of the arcflow model.The consumer context represents a hierarchy, with each consumeridentifier in a superior position to its immediate successor. Thishierarchy has many possible interpretations with the specificinterpretation depending on the particular bindings associated with aspecific application of the model (i.e., a specific set of datacollected and recorded in the model).

The most common interpretation is that of a callstack, e.g., forconsumer context {c₁ c₂ c₃}, the interpretation is that c₁ called c₂ andc₂ then called c₃. Another interpretation is containment, e.g., objectc₁ contains c₂ and c₂ contains c₃.

A tree structure is used for recording the arcflow model. This treestructure (which is referred to as the “call tree”, in deference to themost frequent use of this methodology) consists of a set of nodes, witheach node containing the following information:

{ parent consumer ID, consumer ID, number of occurrences, total resourceconsumption, list of children consumer IDs }

There is a single root node having no parent. This approach reduces thestorage costs of the model to being roughly proportional to the totalnumber of unique contexts in which consumer IDs are encountered in themeasured data. In the case of the present example, there are 11 suchunique contexts. Thus, the call-tree contains 11 nodes. The call treefor the above example is shown graphically in FIG. 5. Each node is shownwith the consumer ID, number of occurrences, and total resourceconsumption. The parents and children are indicated graphically. Infact, there is one more node corresponding to the process/threadconsumer under which the methods Main, A, B, C, X, E, F, and G consumedthe CPU resource. This node has been left out of Table 1 and FIG. 5 as asimplification.

The storage cost reduction in employing this call tree technique is verysignificant. The reduction has broader implications than simply savingspace and speeding data analysis. Since many applications typicallyreach steady state behavior with respect to program flow (that is, aftera relatively short number of entry-exit events, most common callstacksand consumer contexts are realized as elements in a call tree), itbecomes feasible to consider building the call tree live, as resourceconsumption events are recorded. In this way, the need to write theevents at all is obviated, saving both storage and a significant numberof processor cycles.

The arcflow tool generates several standard reports that provideinformation about the trace of the computer program. One such report,and the report from which the arcflow tool obtains its name, is the xarcreport. An example of an xarc report is illustrated in FIG. 6.

Analysts are interested in the consumption of resources, but they aregenerally more interested in why they are consumed. The xarc reporthelps to answer these questions. This report, although textual informat, is actually a graphical rendition of application structure.Individual consumers (e.g., methods in the running example) arepresented along with their resource (e.g., CPU time) usage. The contextfor the consumption is made explicit by linking the consumer with itsparents (e.g., its callers) and its children (e.g., the methods itcalls). In this way it is possible to discern the magnitude of theresource usage of one method, the drivers of that use, and theimplications of changing the behavior of this method.

The xarc report is organized in paragraphs, or stanzas. Stanzas areseparated by dashed (==) lines. Each stanza includes a record for“self,” a set of “parent” records, and a set of “child” records. Everyunique consumer is represented by a stanza in which the self recordidentifies that consumer by name in the “function” column. Three keytypes of metrics are reported for each consumer: “calls,” “base,” and“cum” (short for cumulative). “Calls” indicates the number of times thata consumption event (e.g., a function call) has been recorded on behalfof this consumer. “Base” and “cum” both pertain to the quantity ofresource consumed. “Base” indicates the amount consumed directly by thisconsumer in the context defined by its set of parents. “Cum” indicatesthe amount consumed both by the consumer directly and all of itsdescendants (its children, their children, and so on recursively.) Thedepicted examples in FIG. 6 illustrate a variant of the arcflow reportsthat normalize the resource consumption to percentages rather than showthe absolute counts.

Each stanza focuses an analyst's attention on resource consumption fromthe perspective of a single consumer (the one named in the self recordfor that stanza). This consumer is referred to in the followingdiscussion as the self-consumer. Within each stanza, the interpretationof base and cum depends on which records are being considered. For theself record, base and cum apply directly to all resource consumptionassociated with that function, irrespective of context. For the parentrecords, the base value reports resources consumed by the self-consumerin the context of (e.g., as a result of) the indicated parent. For theparent records, the cum value indicates the resources consumed directlyby the self-consumer and any of its descendants in the context of theindicated parent.

These relationships are formalized in a set of invariants. Understandingthese invariants is important to navigating the report:

Sum(parent(calls))=self(calls): The total number of calls recorded forthe self-consumer are broken out by which parent made the calls;

Sum(parent(base))=self(base): The total resource directly consumed bythe self-consumer can be decomposed into resource consumed on behalf ofeach of the parents of the self-consumer;

Sum(parent(cum))=self(cum): The total resource consumed by theself-consumer (which includes all of its descendant's consumption) canbe decomposed into total resources consumed on behalf of each of theparents of the self-consumer; and

Sum(child(cum))=self(cum)—self(base): The resources consumed by theself-consumer can be decomposed into those directly consumed by theself-consumer and those consumed by its children and their descendants.

As an illustration, FIG. 6 shows the complete set of xarc report stanzasfor the running example discussed above. In the stanza for method main,main is shown as having one parent, named AC_test_pidtid. This isbecause all methods are executed on some thread of control. Theinstrumentation in the depicted implementation associates activity withthe thread that executes it. In effect, the thread becomes thehighest-level consumer or driver of work.

Main is responsible for 100 percent of CPU time consumed although noneof that is within the body of method main, i.e. the children, B and A,are wholly responsible. The children of main are shown as B and A. B isresponsible for 60 percent of the total CPU time consumption, whereas Ais shown as being responsible for 40 percent.

A benefit of the xarc report is in reflecting the performance impacts ofconcepts such as reuse. The analyst can immediately see therelationships between key methods and thus can immediately begin to posemore interesting questions, such as, “What if x were eliminated orimproved substantially?”

Another example of the reports generated by the arcflow tool is thextree report. An example of the xtree report data structure is shown inFIG. 7. The xtree report data structure most closely reflects thecontents of the underlying arcflow model of the trace of the computerprogram. Indeed, it is produced by navigating the call tree directly.The value of the xtree report lies in the completeness of its depictionof application structure coupled with measured performance data. Thextree report data structure communicates more information about programstructure than the xarc report, e.g., discriminating between all uniquecalling sequences, whereas xarc will aggregate across calling sequencesfrom the perspective of a single method.

For example, consider the xarc stanza for method A and compare it withthe xtree information reported below that includes A in the callingsequences. The xarc report is unable to discriminate between executionpaths through A, e.g., A is called by main; A calls B, C, and X. But doall calls from main to A result in a call to C? Indeed no. The xtreereport retains that level of structure.

For example, in FIG. 7 it is shown that method A calls method B, whichthen calls method C only one time. The other call from method A tomethod B does not result in subsequent calls to method C or to any other(instrumented) method.

The present invention uses the xtree information obtained from the xtreereports generated by the arcflow tool to obtain information regardingthe manner by which runs of different builds of a computer programdiffer or remain the same. In one exemplary embodiment of the presentinvention, xtree reports are generated for different builds of acomputer program and are subtracted from one another to obtaininformation regarding what elements of the runs of these two builds aredifferent. In another exemplary embodiment of the present invention, aminimum function is performed using two or more xtree reports of theruns of the same or different builds of a computer program to removeasynchronous or random events from the xtree reports (hereafter simplyreferred to as the “xtrees”. In yet another exemplary embodiment of thepresent invention the “xtrees” of two or more runs of the same ordifferent builds of a computer program are added in order to average outvariations from run to run. In still another embodiment of the presentinvention, a performance regression process is performed on two or morextrees of the same or different builds of a computer program to identifypath changes in key workload flows. Each of these embodiments will bedescribed hereafter.

Xtree Subtraction

In the life of a developing software product, the software may undergomany changes daily to the code in an attempt to improve the code for aspecific purpose. In such a situation, the performance analyst isexpected to be able to quickly identify performance changes, eitherimprovements or regressions due to the changes in the code. While sometools exist for flagging regressions in performance, none of these toolsprovide a context for identifying the cause of this regression. Thepresent invention provides a method for identifying performance andworkload flow changes caused by code changes. With the presentinvention, code path additions, deletions, and modifications betweenbuilds may be identified.

In one exemplary embodiment, the present invention provides a method andapparatus for identifying differences in runs of a computer program thatare due to changes in the code of the computer program. With the presentinvention, call trees are generated for two or more builds of a computerprogram. The present invention involves performing a “tree-subtract”operation in which the two or more call trees generated during runs oftwo or more different builds of a computer program are subtracted fromone another to identify build to build differences in the execution ofthe computer program.

As an example of the manner by which the runs of two different builds ofa computer program are subtracted to identify differences between theexecution of the builds of the computer program, consider the two setsof trace data shown in FIGS. 8A and 8B. The set of trace data shown inFIG. 8A represents a run of a first build of the computer program, i.e.build A, and the set of trace data shown in FIG. 8B represents a run ofthe second build of the computer program, i.e. build B. These two setsof trace data are obtained from a trace tool, such as jprof, developedby International Business Machines, Inc. The two sets of trace data usethe same format as previously described above with regard to FIG. 4,except the numbers in FIGS. 8A and 8B represent actual resourceconsumption. These sets of trace data are used as input to the modifiedarcflow tool of the present invention in order to obtain a subtractedtree data structure, which is also an xtree, identifying the differencesin the runs of the two builds of the computer program.

Having obtained two sets of trace data from a trace tool, the presentinvention inputs this trace data into a modified arcflow tool thatgenerates a call tree for each of the sets of trace data. FIGS. 9A and9B show the call tree data structures in a graphical format, whichcorrespond to the input data of FIGS. 8A and 8B, respectively. FIGS. 10Aand 10B show the same call tree data structures in textual format,similar to that in FIG. 7 except that two columns have been addedshowing the actual base and cum resource consumption in addition topercentages. Thus, for example, the value “3”, in the base field 1010for the entry corresponding to method A indicates that 3 CPU cycles werespent executing instructions that are within method A. The value “22”,in the cum field 1020 for the entry corresponding to method A indicatesthat 22 CPU cycles were spent executing instructions in method A or A'sdescendants, e.g., methods B, C and D.

These call trees are then used to perform the subtraction according tothe present invention. The process starts by generating a copy of thecall tree for the first build A, i.e. the call tree in FIG. 9A, andadding a pass field which is set to 1 for each of the nodes of the calltree A. Since this copy of the call tree data structure is essentiallythe same as that shown in FIG. 9A with the addition of the pass fieldvalue, for simplicity, the following description will make reference toFIG. 9A.

The call tree (FIG. 9B) for the second build of the computer program,i.e. build B, is then walked over the copy of the call tree for thefirst build A (FIG. 9A). That is, at each step of walking the tree forthe second build B in FIG. 9B, if a corresponding node exists in thecopy of the call tree for the first build A in FIG. 9A, then thecalls/base value for this node is set to the calls/base of the copy ofthe first call tree A in FIG. 9A, minus the calls/base of the secondcall tree B in FIG. 9B. The pass field is then set to 3 to denote thatboth the first call tree A and the second call tree B contributed to thenode.

If there is no corresponding node that exists in the first call tree A(FIG. 9A), then a node is created with a negative value of base andcalls for the second call tree B (FIG. 9B). In this case, the pass fieldis set to 2 denoting that only the second call tree (FIG. 9B)contributed to this node. Thus, from the pass field values, it can bedetermined whether only the first call tree, only the second call tree,or both call trees contributed to a corresponding node or entry in asubtracted call tree data structure.

After walking the entire second tree (FIG. 9B) and performing thesubtraction in this manner above, a resulting tree data structure isobtained that retains all the call stack context from either of thefirst and second call tree. This resulting tree data structure is shownin FIG. 11. All of the Call, Base and Cum values in the resulting treedata structure in FIG. 11 are the difference between the two originaltrees, i.e. FIGS. 9A and 9B. The pass value is provided in the depictionof the resulting tree as well so that it is clear which call treescontributed to each node of the resulting tree.

In the extremely simple example represented by FIGS. 9A and 9B, it isobvious that the improved performance of this program is entirely due tothe substitution of method E, taking only 6 CPU seconds, for method Dwhich took 7 CPU seconds. But real software systems may consist ofmillions of lines of code, thousands of different methods or routines,each of which may be called in dozens of callstack contexts, resultingin xtrees with tens of thousands of nodes. Furthermore, from one buildto the next there may be hundreds of code changes, most of which have nodiscernable impact on performance. In such a real-world situation,finding which changes are responsible for a measured performance changecan be extremely difficult. The value of the present invention is thatit highlights exactly the code changes most responsible for changes inperformance.

The “CumA” field 1130 in FIG. 11 is the sum of the absolute values ofall the changes in the traced metric associated with a method and itsdescendants. This value is important for identifying areas of code inwhich substantial performance changes have occurred, but which mostlycancelled each other out, resulting in only a small net change. In thepresent example, at the top level in method A, build B was only one CPUsecond faster than build A, as reflected in the value of “1” in thecolumn labeled “Cum”, but underneath there was considerable “churn”,with a deletion of seven seconds and an addition of six; the large valueof 13 in the column labeled “CumA” calls the analyst's attention to thisfact.

FIG. 12 is a subtraction xtree report (or subtraction xtree) generatedby performing the tree subtraction operation previously described. Thissubtraction xtree is obtained by subtracting the values associated withthe base field 1010 and the number or calls field 1040 of the xtree forthe second build, i.e. FIG. 10B from the values for these fields for thefirst build, i.e. FIG. 10A. Thus, for example, in the subtraction xtreeof FIG. 12, method A has a base of 0 (i.e. 3−3=0), and a number of callsof 0 (i.e. 1−1=0). Method B is not listed since both the base value forMethod B and the cum value for method B, discussed hereafter, becomeszero after subtraction (i.e. 7−7=0). Method C has a base value of 0after subtraction (i.e. 5−5=0) and a number of calls of 0 (i.e., 1−1=0),method D has a base value of 7 (i.e. 7−0=7) and a number of calls of 1(i.e., 1−0=1), and method E has a base value of −6 (i.e. 0−6=−6) and anumber of calls of −1 (i.e. 0−1=−1).

The cum field 1120 and CumA field 1130 values are then calculated basedon the new subtracted values for the base field. As a result, method A'scum value is 1 and absolute cumulative value is 13 representing 7 CPUcycles used in method D and 6 CPU cycles used in method E.

In the subtraction xtree shown in FIG. 12, methods whose paths have notchanged between builds have zero path values or are not present in thesubtraction xtree. Thus, for example, method B is not present in thesubtraction xtree because the path of method B, i.e. the base number ofmetrics associated with method B and the cumulative number of metricsassociated with method B and any methods called by method B, is the samebetween builds. Methods A and C have base values that are 0, meaningthat there is no change in the runs of the builds with respect to thenumber of metrics utilized only by methods A and C. However, methods Aand C have cumulative values of 1 meaning that the methods called by Aand C have resulted in an increase in resource usage of 1 metric unitbetween builds.

Method D has a base value and a cumulative value of 7 meaning that themethod D increases the resource usage by 7 between builds and that thisincrease is due to the execution of instructions within method D. Thepositive numbers for base and cumulative values indicates that thelarger amount of resource usage with regard to method D is with regardto the first build of the computer program. Similarly, method E has abase and cumulative value of −6 indicating that the method E increasesthe resource usage by 6 between builds and that this increase is due tothe execution of instructions within method E. Furthermore, the negativebase and cumulative values indicates that the larger amount of resourceusage with regard to method E is with regard to the second build of thecomputer program.

The positive base and cumulative values also indicate where there havebeen improvements due to build-to-build changes in the code. A positivebase and cumulative value indicates, at least with respect to resourceusage, an improvement in the code since the second build requires lessresource usage than the first build. A negative value indicates anincrease in resource usage (a “regression” in performance terminology)in the second build of the computer program due to the method associatedwith the negative value.

In addition to the base and cum fields of the subtraction xtree, theCumA field provides information identifying the location of the changesin resource usage within the execution paths of the computer program.For example, the CumA value of method A is 13, yet the cumulative valueof method A is 1. Thus, the change in resource usage may be clearlyidentified as being associated with methods called by method A or theirdescendants, i.e. methods C, D and E. Similarly, method C has acumulative value of 1 and a CumA value of 13, which indicates that theresource usage is associated with methods called by method C. Sincemethods D and E have the same absolute cum and CumA values, the resourceusage indicated here is attributable to methods D and E directly.

A number of flowcharts will be described hereafter, which illustratevarious operations of embodiments of the present invention. It will beunderstood that each block of the flowchart illustrations, andcombinations of blocks in the flowchart illustrations, can beimplemented by computer program instructions. These computer programinstructions may be provided to a processor or other programmable dataprocessing apparatus to produce a machine, such that the instructionswhich execute on the processor or other programmable data processingapparatus create means for implementing the functions specified in theflowchart block or blocks. These computer program instructions may alsobe stored in a computer-readable memory or storage medium that candirect a processor or other programmable data processing apparatus tofunction in a particular manner, such that the instructions stored inthe computer-readable memory or storage medium produce an article ofmanufacture including instruction means which implement the functionsspecified in the flowchart block or blocks.

Accordingly, blocks of the flowchart illustrations support combinationsof means for performing the specified functions, combinations of stepsfor performing the specified functions and program instruction means forperforming the specified functions. It will also be understood that eachblock of the flowchart illustrations, and combinations of blocks in theflowchart illustrations, can be implemented by special purposehardware-based computer systems which perform the specified functions orsteps, or by combinations of special purpose hardware and computerinstructions.

As shown in FIG. 13, the operation starts by receiving trace data from atrace of the execution of two or more different builds of a computerprogram (step 1310). Thereafter, the trace data is input to an arcflowtool to obtain a call tree data structure for each execution of the twodifferent builds (step 1320). The call tree data structure for theexecution of one of the builds of the computer program is thensubtracted from the call tree data structure for the other execution ofthe other build of the computer program (step 1330). The resulting calltree data structure is then used to generate a subtraction xtree datastructure (step 1340) which is then output for use by an analyst inidentifying the differences in execution of the computer program thatare due to changes in the code of the computer program between builds(step 1350). This process may be repeated for each pair of trace datasets that need to be compared to identify differences in the executionof the builds that are due to code changes.

Thus, from the subtraction xtree generated using the present invention,the changes in resource utilization of the paths of execution of thedifferent builds of the computer program may be determined. That is, theimprovements/regressions that have occurred from going from one build toanother may be clearly identified in the subtraction xtree. Furthermore,the context or locations of these improvements/regressions may bepinpointed using the subtraction xtree.

Xtree Addition

The above embodiments of the present invention provide a mechanism fordetermining changes in execution of a computer program that are due tochanges in the code of a computer program from one build to the next. Inaddition to being able to identify differences in executions of buildsof a computer program that are due to changes in the code, the presentinvention provides a mechanism for averaging out variations from run torun of a computer program.

As discussed previously, it is part of a performance analyst's job tomeasure and explain changes in performance from one build or version ofa program to another. But the very same build of a program may notexhibit exactly the same performance from run to run. Performancevariation can be caused by external factors, such as variations innetwork traffic, or internal factors, such as variation in disk accesstime. If the normal performance variation of a given program is of amagnitude greater than or equal to the difference in performance betweentwo builds, the exact difference between the two builds may beimpossible to determine. In such cases, it is useful to run each buildmultiple times and calculate the average performance of each build. Bycomparing the two averages, one can conclude that, on average, build Ais faster/slower than build B. In such a case, in order to be able toapply the arcflow methodology to determine the cause of this performancedifference, an xtree is needed that represents the average of multiplextrees.

Another situation in which the average of multiple xtrees is useful isin amortizing the effect of anomalies on perceived performance. Forexample, it may happen that during the execution of a program, theoperating system must suspend execution of the program to handle aninterrupt and then resume execution of the program. If this occurs, forexample, while the program was executing method D, the apparent pathlength of method D will be much longer than it actually is. This in turncan lead a performance analyst to draw incorrect conclusions about aperformance improvement or regression. However, if one takes trace dataof multiple runs of a given build, creates xtrees from each trace, andconstructs an xtree of their average, the apparent effect of suchanomalies is much smaller. This allows the analyst to focus onperformance changes that are truly the effect of changes in programimplementation.

The present invention provides a mechanism for adding two or more calltree data structures to obtain a new call tree data structure thatrepresents the addition of these two or more call tree data structures.By adding the two or more call tree data structures, run to runanomalies that are not inherent in the structure of the program may beamortized. The call tree data structure that results from this additionof the two or more call tree data structures for different runs of thecomputer program automatically amortizes random events which may or maynot occur in different places in each run, and which may or may not havedifferent costs associated with them.

As with the xtree subtraction discussed above, the xtree addition andaveraging mechanism of the present invention starts by receiving tracedata from traces of executions of the computer program. This trace datais input to an arcflow tool to generate xtree data structures for thetrace data sets that are input.

Xtree data structures are then added by taking a first xtree datastructure and walking the xtree data structure. As the first xtree datastructure is walked, the call and base values are set in accordance withthe trace data and the xtree data structure. The second xtree datastructure is walked over the first xtree data structure in a similarmanner as discussed above with regard to the xtree subtraction mechanismof the present invention. However, whenever a new node is encountered inthe second xtree data structure that is not in the first xtree datastructure, a new node of the resulting call tree is generated torepresent this new node. If a matching node is found in both the firstand second xtree data structures, the call values and the base valuesare added. This process continues until the entire second xtree datastructure is walked over the entire first xtree data structure.

This process may be repeated for each additional xtree data structurethat is to be added. In subsequent additions, the result of the firstand second xtree data structures may be considered a first xtree datastructure in the subsequent addition. In this way, the resulting xtreedata structure is a sum of each of the individual xtree data structuresfor the various runs of the computer program as obtained from the tracedata compiled during the runs of the computer program.

Referring to FIGS. 14A and 14B, assume that FIG. 14A represents the calltree data structure associated with a first run of a computer programand FIG. 14B represents the call tree data structure associated with asecond run of the computer program. In such a situation, the change invalues for method D may represent variations or anomalies that may occurduring runs of the computer program. For example, the increase in baseand cum for method D may be due to an interrupt being processed thatcauses additional CPU time to be attributed to method D.

FIG. 14C is an exemplary diagram of a resulting call tree data structureobtained from the addition of the call tree data structures of FIG. 14Aand FIG. 14B. In actuality, FIG. 14C is the addition of one run thatresults in the call tree data structure of FIG. 14A, and three runs thateach result in the call tree data structure of FIG. 14B. As shown inFIG. 14C, the resulting call tree data structure differs from the calltree data structure obtained through subtraction of xtrees as depictedin FIG. 10 in that node B is not eliminated and the base and cumulativevalues are the sum of the base and cumulative values for correspondingnodes. Furthermore, it can be seen from FIG. 14C that the anomaly of 10CPU seconds being attributed to method D can be averaged out by dividingthe values for the methods by the number of sets of trace data that arebeing added together. Thus, dividing the values for method D by 4, theresult is 7. This average value would continue to approach 6 as moreruns of the computer program are traced and added. In this way, theaffect of anomalies on the resulting call tree data structure may beaveraged out.

FIG. 15 is an exemplary xtree data structure corresponding to, andobtained from, the call tree data structure of FIG. 11. As shown in FIG.15, the number of calls and the base values for the methods in the calltree data structure are equal to the addition of the call and basevalues of the nodes of each individual call tree data structure. Thecumulative value and the absolute cumulative values are calculated basedon the base values for each of the methods (base) and the methods thatthey call (cumulative).

The average of these call, base, cumulative, and absolute cumulativevalues may be obtained by dividing these values by the number of calltree data structures or xtree data structures that are added together.Thus, for example, the average call, base, cumulative and absolutecumulative values for the example illustrated in FIG. 15 may be obtainedby dividing each of these values by 2, i.e. the number of call tree datastructures that were added. As a result, the average base value formethods A-E would be 3, 7, 5, 3.5 and 3, respectively. The averagecumulative values would be 21.5, 7, 11.5, 3.5 and 3. It can be seen fromthis example that, as the number of runs that are added are increased,the resource usage cost associated with variations, such as methods Dand E, will be averaged out, i.e. the average values become smaller andsmaller, while the values for the core methods of the executions of thecomputer program maintain a relatively higher resource usage.

FIG. 16 is a flowchart outlining an exemplary operation of the presentinvention when adding call tree data structures for a plurality of runsof a computer program and averaging out variations from run to run. Aswith FIG. 13 above, it will be understood that each block of theflowchart illustration, and combinations of blocks in the flowchartillustration, can be implemented by computer program instructions. Thesecomputer program instructions may be provided to a processor or otherprogrammable data processing apparatus to produce a machine, such thatthe instructions which execute on the processor or other programmabledata processing apparatus create means for implementing the functionsspecified in the flowchart block or blocks. These computer programinstructions may also be stored in a computer-readable memory or storagemedium that can direct a processor or other programmable data processingapparatus to function in a particular manner, such that the instructionsstored in the computer-readable memory or storage medium produce anarticle of manufacture including instruction means which implement thefunctions specified in the flowchart block or blocks.

Accordingly, blocks of the flowchart illustration support combinationsof means for performing the specified functions, combinations of stepsfor performing the specified functions and program instruction means forperforming the specified functions. It will also be understood that eachblock of the flowchart illustration, and combinations of blocks in theflowchart illustration, can be implemented by special purposehardware-based computer systems which perform the specified functions orsteps, or by combinations of special purpose hardware and computerinstructions.

As shown in FIG. 16, the operation starts by receiving trace data from atrace of the execution of two or more runs of a computer program (step1610). Thereafter, the trace data is input to an arcflow tool to obtaina call tree data structure for each execution of the computer program(step 1620). The call tree data structure for the execution of one ofthe runs of the computer program is then added to the call tree datastructure for the other execution of another run of the computer program(step 1630).

A determination is made as to whether there are any more call tree datastructures to added (step 1640). If so, the operation returns to step1630 and adds the next call tree data structure to the previouslyobtained sum of the call tree data structures. If there are no more calltree data structures to add, the resulting call tree data structure isthen used to generate an addition xtree (or xtree) data structure (step1650). The call, base, cumulative and absolute cumulative values maythen be averaged based on the number of call tree data structures added(step 1660). The resulting call tree data structure with the averagedvalues may then be output for use by an analyst in identifying the costsassociated with variations occurring within multiple executions of acomputer program (step 1670). The operation then terminates.

In this way, variations in context for multiple runs of the sameapplication may be averaged out. Moreover, run to run anomalies that arenot inherent in the structure of the program are amortized. Thus, theresulting call tree data structure obtained through the use of thisinvention automatically amortizes random events which may or may notoccur in different places in each run, and which may or may not havedifferent resource usage costs associated with them.

Xtree Minimization

In addition to the above, the present invention provides a mechanism fordetermining a minimum tree data structure for various runs of the samebuild of a computer program. While the above xtree subtraction mechanismof the present invention is utilized to determine changes in runs thatare due to changes in the code of a computer program between builds, theminimization mechanism of the present invention determines the minimumxtree data structure that is consistent from run to run. In this way,noise, e.g. asynchronous events like paging, interrupts, memoryallocation variances, and the like, may be eliminated from the minimizedtree. By eliminating this “noise”, the minimized xtree of the presentinvention helps to identify the core part of the trace of the computerprogram that an analyst should focus on when determining how to optimizethe execution of the computer program rather than wasting time onportions of the computer program that do not appreciably affect therunning of the computer program.

In this embodiment of the present invention, a minimum xtree isgenerated based on two or more xtree data structures. The minimum xtreeis generated by walking the xtree data structures and only including inthe minimum tree those nodes that are present in each of the xtree datastructures being walked.

For example, assume that three xtree data structures are generated basedon trace data from three different runs of the same build of a computerprogram. These three xtree data structures are labeled A, B and C. Xtreedata structure B is walked over xtree data structure A to determine thenodes of the xtree data structures that are consistent between runs. Thextree data structure C is then walked over the xtree data structureresulting from the comparison of xtree data structure A and xtree datastructure B.

With each comparison, the lowest values associated with the common nodesare maintained in the resulting minimized xtree data structure. Theresult of these operations is a minimized xtree data structure in whichthe “noise” generated by asynchronous events is removed.

FIGS. 17A-C are exemplary diagrams of graphical representations of xtreedata structures that may be generated based on trace data obtained fromruns of the same build of a computer program. FIG. 18A is an exemplarydiagram of a graphical representation of the minimum xtree datastructure generated by a walking of the xtree data structure in FIG. 17Bover the xtree data structure in FIG. 17A. As shown in FIG. 18A, thecommon nodes between these xtree data structures are nodes A, B and Cwith minimum base values of 6, 12 and 8, respectively, being maintained.The cumulative values are generated from these minimum maintained basevalues.

FIG. 18B is an xtree data structure obtained by walking the xtree datastructure in FIG. 17C over the minimum xtree data structure shown inFIG. 18A. As shown in FIG. 18B, the common nodes between the minimumxtree data structure in FIG. 18A and those in the xtree data structureof FIG. 17C are nodes A, B and C with minimum base values of 6, 10 and8, respectively, being maintained. Thus, the result of these operationsis a minimum xtree data structure in which only the common nodes betweenthe three original xtree data structures are maintained with minimumvalues.

This minimum xtree data structure eliminates the noise that is presentin the original xtree data structures, e.g., asynchronous events. As aresult, only those portions of code that are present in each of the runsof the computer program are present in the minimum xtree data structure.Thus, only those portions of code that are most likely to affect eachrun of the computer program are considered when an analyst analyzes theminimum xtree data structure. From this minimum xtree data structure,the analyst may determine which portions of code could be optimized toaffect all runs of the computer program.

FIG. 19 is a flowchart outlining an exemplary operation of the presentinvention when generating a minimized xtree data structure. As shown inFIG. 19, the operation starts by receiving trace data from a pluralityof traces of the execution of the same build of a computer program (step1910). Thereafter, the trace data is input to an arcflow tool to obtaincall tree data structures, e.g., xtree data structures, for eachexecution of the computer program (step 1920). The call tree datastructures are then walked over each other in order to generate aminimized call tree data structure that includes only those nodes thatare common to each call tree data structure (step 1930). The resultingminimized call tree data structure is then output for use by an analystin identifying portions of the computer program that may be optimized toaffect every run of the computer program (step 1940). The operation thenterminates.

Xtree Automatic Performance Regression

The above embodiments of minimization of xtree data structures and xtreedata structure subtraction may be combined in order to identifyperformance regressions between builds. Since the code of a developingproduct may change daily and may be the result of a merge of a largenumber of code changes, it is important to automatically ascertain whichof these changes actually result in a difference in the execution of thecomputer program rather than merely causing asynchronous anomalies inthe running of the computer program.

In this further embodiment of the present invention, multiple traces ofa build of a computer program are obtained in order to generate xtreedata structures based on the trace data. These xtree data structures arethen utilized to create a minimum xtree data structure for that build ofthe computer program.

This same process is repeated for a different build of the computerprogram. That is, multiple traces of the execution of a second build ofthe computer program are performed in order obtain xtree data structuresfor each trace of the second build of the computer program. These xtreedata structures are then utilized to obtain a minimum xtree datastructure for the second build of the computer program.

In this way, the “noise” is eliminated from the traces of the first andsecond builds of the computer program. Thus, only those portions of codein the traces of the execution of each of the first and second buildsthat appreciably and consistently affect the execution of the computerprogram are maintained in the minimum xtree data structures for eachbuild.

The minimum xtree data structures for each build are then subtractedfrom one another in order to identify the differences. This subtractionis performed in the same manner as discussed above. By performing thissubtraction, differences between the builds are highlighted. Thesedifferences may be compared to thresholds so that when a differenceexceeds a threshold, e.g., a cumulative value for a method exceeds aparticular threshold, an alert and message may be generated and reportedto an analyst.

In addition, this performance regression processing may be performedbetween more than two builds of a computer program. That is, theoperations discussed above may be repeated for each pair of builds inorder to determine how transitioning from one build to the next affectsthe overall execution of the computer program.

The above embodiments are preferably implemented in an automatic manner.That is, human intervention is not necessary to initiate and perform theoperations of tree-subtraction, tree-addition, minimum tree processing,or performance regression processing. To the contrary, upon obtaining aplurality of traces of the same or different builds, the variousoperations that are enabled on a computing system may be automaticallyinitiated so as to generate the appropriate xtree data structures foruse by a human analyst in analyzing the execution of one or more buildsof the computer program. In addition, these operations may be performedindividually or in any combination to generate all of the informationthat may be of interest to the human analyst.

FIG. 20 is a flowchart outlining an exemplary operation of the presentinvention when performing autonomic performance regression processing.As shown in FIG. 20, the operation starts by receiving trace data from aplurality of traces of the execution of the two or more different buildsof a computer program (step 2010). Thereafter, the trace data is inputto an arcflow tool to obtain call tree data structures, e.g., xtree datastructures, for each execution of the computer program (step 2020).Thereafter, for each set of call tree data structures for each build, aminimum call tree data structure is generated (step 2030). The resultingminimized call tree data structures are then subtracted from one anotherto generate a subtracted minimum call tree data structure (step 2040).

Entries in the subtracted minimum call tree data structure that are theresult of only one of the builds are then identified (step 2050). Thevalues associated which these entries are compared to one or morethresholds (step 2060). A determination is then made as to whether anyof the thresholds are satisfied or not satisfied, depending on theparticular embodiment, e.g., are met or exceed (or conversely, not metor exceeded) (step 2070). If the thresholds are satisfied or notsatisfied, depending on the situation, an alert and message may beoutput to a human analyst (step 2080). Other alternative methods foralerting may be used, such as changing display formats, colors, and thelike. The operation then terminates.

Thus, in this additional embodiment of the present invention, changesbetween builds that will consistently and appreciably affect runs of thecomputer program are identified. In addition, those changes that may bethe result of errors or unwanted conditions within the execution of thecomputer program are automatically identified. In this way, theanalyst's attention is focused on areas of the computer program that maybe optimized to obtain a consistently better execution of the computerprogram.

It is important to note that while the present invention has beendescribed in the context of a fully functioning data processing system,those of ordinary skill in the art will appreciate that the processes ofthe present invention are capable of being distributed in the form of acomputer readable medium of instructions and a variety of forms and thatthe present invention applies equally regardless of the particular typeof signal bearing media actually used to carry out the distribution.Examples of computer readable media include recordable-type media, suchas a floppy disk, a hard disk drive, a RAM, CD-ROMs, DVD-ROMs, andtransmission-type media, such as digital and analog communicationslinks, wired or wireless communications links using transmission forms,such as, for example, radio frequency and light wave transmissions. Thecomputer readable media may take the form of coded formats that aredecoded for actual use in a particular data processing system.

The description of the present invention has been presented for purposesof illustration and description, and is not intended to be exhaustive orlimited to the invention in the form disclosed. Many modifications andvariations will be apparent to those of ordinary skill in the art. Theembodiment was chosen and described in order to best explain theprinciples of the invention, the practical application, and to enableothers of ordinary skill in the art to understand the invention forvarious embodiments with various modifications as are suited to theparticular use contemplated.

1. A method, in a data processing system, for averaging out variationsin trace data comprising: executing a computer program a plurality oftimes to obtain trace data; obtaining call tree data structurescorresponding to the trace data for the plurality of executions of thecomputer program; adding the call tree data structures to generate anadded call tree data structure; calculating an average of valuesassociated with each node in the added call tree data structure togenerate an averaged call tree data structure; and outputting theaveraged call tree data structure, wherein the effect of variations intrace data of various executions of the computer program are minimizedin the averaged call tree data structure.
 2. The method of claim 1,further comprising: inputting the trace data to an arcflow tool, whereinthe arcflow tool generates the call tree data structures based on thetrace data.
 3. The method of claim 1, wherein the call tree datastructures are xtree data structures.
 4. The method of claim 1, whereinadding the call tree data structures to generate an added call tree datastructure includes: copying a first call tree data structure; andwalking a second call tree data structure over the first call tree datastructure to generate the added call tree data structure.
 5. The methodof claim 4, wherein walking the second call tree data structure over thefirst call tree data structure includes: for each node that exists inboth the first call tree data structure and the second call tree datastructure, generating a node in the added call tree data structure byadding a base value of the node in the second call tree data structureto a base value of a corresponding node in the first call tree datastructure.
 6. The method of claim 4, wherein walking the second calltree data structure over the first call tree data structure includes:for each node that exists in only one of the first call tree datastructure and the second call tree data structure, creating a node inthe added call tree data structure having a base value corresponding tothe base value of the node that exists in either of the first call treedata structure or the second call tree data structure.
 7. The method ofclaim 1, wherein calculating an average of values associated with eachnode in the added call tree data structure to generate an averaged calltree data structure includes: dividing values associated with each nodein the added call tree data structure by a total number of call treedata structures that were added to generate the added call tree datastructure.
 8. The method of claim 1, wherein the values associated witheach node include a base value, a number of calls, a cumulative value,and an absolute cumulative value.
 9. A computer program product,comprising: a recordable-type computer readable medium having computerreadable program code for averaging out variations in trace dataobtained from a plurality of executions of a computer program, thecomputer program product comprising: first instructions for obtainingcall tree data structures corresponding to the trace data for theplurality of executions of the computer program; second instructions foradding the call tree data structures to generate an added call tree datastructure; third instructions for calculating an average of valuesassociated with each node in the added call tree data structure togenerate an averaged call tree data structure; and fourth instructionsfor outputting the averaged call tree data structure, wherein the effectof variations in trace data of various executions of the computerprogram are minimized in the averaged call tree data structure.
 10. Thecomputer program product of claim 9, further comprising: fifthinstructions for inputting the trace data to an arcflow tool, whereinthe arcflow tool generates the call tree data structures based on thetrace data.
 11. The computer program product of claim 9, wherein thecall tree data structures are xtree data structures.
 12. The computerprogram product of claim 9, wherein the second instructions for addingthe call tree data structures to generate an added call tree datastructure include: instructions for copying a first call tree datastructure; and instructions for walking a second call tree datastructure over the first call tree data structure to generate the addedcall tree data structure.
 13. The computer program product of claim 12,wherein the instructions for walking the second call tree data structureover the first call tree data structure include: for each node thatexists in both the first call tree data structure and the second calltree data structure, instructions for generating a node in the addedcall tree data structure by adding a base value of the node in thesecond call tree data structure to a base value of a corresponding nodein the first call tree data structure.
 14. The computer program productof claim 12, wherein the instructions for walking the second call treedata structure over the first call tree data structure includes: foreach node that exists in only one of the first call tree data structureand the second call tree data structure, instructions for creating anode in the added call tree data structure having a base valuecorresponding to the base value of the node that exists in either of thefirst call tree data structure or the second call tree data structure.15. The computer program product of claim 9, wherein the thirdinstructions for calculating an average of values associated with eachnode in the added call tree data structure to generate an averaged calltree data structure include: instructions for dividing values associatedwith each node in the added call tree data structure by a total numberof call tree data structures that were added to generate the added calltree data structure.
 16. The computer program product of claim 9,wherein the values associated with each node include a base value, anumber of calls, a cumulative value, and an absolute cumulative value.17. An apparatus for averaging out variations in trace data obtainedfrom a plurality of executions of a computer program, comprising: one ormore processors coupled to a memory; means for obtaining call tree datastructures corresponding to the trace data for the plurality ofexecutions of the computer program; means for adding the call tree datastructures to generate an added call tree data structure; means forcalculating an average of values associated with each node in the addedcall tree data structure to generate an averaged call tree datastructure; and means for outputting the averaged call tree datastructure, wherein the effect of variations in trace data of variousexecutions of the computer program are minimized in the averaged calltree data structure.
 18. The apparatus of claim 17, further comprising:means for inputting the trace data to an arcflow tool, wherein thearcflow tool generates the call tree data structures based on the tracedata.
 19. The apparatus of claim 17, wherein the call tree datastructures are xtree data structures.
 20. The apparatus of claim 17,wherein the means for adding the call tree data structures to generatean added call tree data structure includes: means for copying a firstcall tree data structure; and means for walking a second call tree datastructure over the first call tree data structure to generate the addedcall tree data structure.
 21. The apparatus of claim 20, wherein themeans for walking the second call tree data structure over the firstcall tree data structure includes: for each node that exists in both thefirst call tree data structure and the second call tree data structure,means for generating a node in the added call tree data structure byadding a base value of the node in the second call tree data structureto a base value of a corresponding node in the first call tree datastructure.
 22. The apparatus of claim 20, wherein the means for walkingthe second call tree data structure over the first call tree datastructure includes: for each node that exists in only one of the firstcall tree data structure and the second call tree data structure, meansfor creating a node in the added call tree data structure having a basevalue corresponding to the base value of the node that exists in eitherof the first call tree data structure or the second call tree datastructure.
 23. The apparatus of claim 17, wherein the means forcalculating an average of values associated with each node in the addedcall tree data structure to generate an averaged call tree datastructure includes: means for dividing values associated with each nodein the added call tree data structure by a total number of call treedata structures that were added to generate the added call tree datastructure.